package org.yenn.pattern.aliyun.j2ee.businessdelegate;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * @Author: yerenyun
 * @Description:步骤 6
 * 使用 BusinessDelegate 和 Client 类来演示业务代表模式。
 */
public class BusinessDelegatePatternDemo {

    /**
     * 步骤 7
     * 验证输出。
     *
     * Processing task by invoking EJB Service
     * Processing task by invoking JMS Service
     */
    @Test
    public void doTask() {
        BusinessDelegate businessDelegate = new BusinessDelegate();
        businessDelegate.setServiceType("EJB");

        Client client = new Client(businessDelegate);
        client.doTask();

        businessDelegate.setServiceType("JMS");
        client.doTask();

    }
}